var WebDeveloper = WebDeveloper || {};

WebDeveloper.Preferences = WebDeveloper.Preferences || {};


// Sets an integer preference  FROM LINE 234 OF PREFERENCES.JS
WebDeveloper.Preferences.setIntegerPreference = function(preference, value, branch)
{
  // If the branch is not set
  if(!branch)
  {
    branch = WebDeveloper.Preferences.getGlobalBranch();
  }

  branch.setIntPref(preference, value);
};
// Sets an integer preference  FROM LINE 234 OF PREFERENCES.JS


// Returns the global preferences branch
WebDeveloper.Preferences.getGlobalBranch = function()
{
  return WebDeveloper.Preferences.getBranch("");
};


// Returns the preferences branch
WebDeveloper.Preferences.getBranch = function(branch)
{
  return WebDeveloper.Preferences.getPreferencesService().getBranch(branch);
};


// Returns the preferences service
WebDeveloper.Preferences.getPreferencesService = function()
{
  // If the preferences service is not set
  if(!WebDeveloper.Preferences.preferencesService)
  {
    WebDeveloper.Preferences.preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
  }

  return WebDeveloper.Preferences.preferencesService;
};